package com.qf.front.task;

import com.qf.front.biz.OrderService;

import java.util.Timer;
import java.util.TimerTask;

public class OrderTimer extends TimerTask {

    private OrderService orderService;
    private String  oid;
    private Timer timer;


    public  OrderTimer(){

    }

    public OrderTimer(OrderService orderService, String oid, Timer timer) {
        this.orderService = orderService;
        this.oid = oid;
        this.timer = timer;
    }

    @Override
    public void run() {

        orderService.updOstatus(oid);//设置订单失效

        timer.cancel();//关闭定时器


    }
}
